<?php 
// wymagane w layout
echo $this->Section->main();
?>

<body>
<div class="main">
	<?php echo $this->element('header')?>

	<div class="content">
		<div class="content_resize">
      
			<div class="sidebar">
				<div class="gadget">
					<h2 class="star">Menu</h2>
					<?php echo $this->element('left_menu')?>
				</div>

			</div>
			<!-- sidebar/ -->
			<div class="mainbar">
				<h2>Dodaj wpis</h2>

				<?php
				echo $javascript->link('ckeditor/ckeditor');
				//$config['toolbar'] = array( 
				//    array( 'Bold', 'Italic', 'Underline', 'Strike' ), 
				//    array( 'Image', 'Link', 'Unlink', 'Anchor' ) 
				//); 
				$config['height'] = 400;
				?>
				
				<div class="news form">
				<?php echo $cksource->create(__("News",true),array('url'=>array('plugin'=>'calendar','controller'=>'news','action'=>'add'),'type' => 'file'));?>

					<?php
						echo $this->Form->input('name',array('label'=>__d('calendar','Tytuł',true),'style'=>'width: 100%'));
						echo $this->Form->input('small_content',array('label'=>__d('calendar','Treść do listy',true),'style'=>'width: 100%; height: 60px'));
						echo $this->Form->input('content',array('label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%; height:120px'));
						echo $cksource->ckeditor('content',array('config'=>$config, 'label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%;'));
						echo $this->Form->input('on_date',array('label'=>'Data'));
						echo $this->Form->input('NewUpload.0.file', array('type' => 'file','label'=>__d("calendar","Zdjęcie",true)));
						echo $this->Form->input('url',array('label'=>__d('calendar','Adres URL',true),'style'=>'width: 100%'));
						echo $this->Form->input('new_group_id',array('label'=>'Type','options'=>$newsGroups));
					?>

				<?php echo $this->Form->end(__('Submit', true));?>
				</div>
				
				
				<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
				
				<?php $this->Footpanel->install();?>
				<div id="footpanel">
					<ul>
						<li><?php echo $this->Html->link(__('Home', true).'<small>'.__('Home', true).'</small>', array('plugin'=>'calendar','controller'=>'news','action'=>'index'),array('escape'=>false,'class'=>'home')); ?></li>
						<li><?php echo $this->Html->link(__('Add News', true).'<small>'.__('Add News', true).'</small>', 
							array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)')); ?></li>					
					</ul>
				</div>
				<?php }?>

			</div>
			<div class="clr"></div>
		</div>
	</div>
	<?php echo $this->element('footer_fbg')?>
	<?php echo $this->element('footer')?>
</div>
</body>
